<?php
/**
 * 视图控制
 * @copyright (c) iDoo All Rights Reserved
 */

class View {
	public static function getView($template, $ext = '.php') {
		
		$tplname = 'default';
		$tpl_path = TPLS_PATH.'/'.$tplname.'/';

		if(!is_dir($tpl_path)) {
			idooMsg('模板已被删除或损坏！'.$tplname);
		}
		if(!file_exists($tpl_path . $template . $ext)){
			idooMsg('模板文件不存在！'.$actionName.":".$template);
		}
		return $tpl_path . $template . $ext;
	}

	public static function output() {
		$content = ob_get_clean();
        ob_start();
		echo $content;
		ob_end_flush();
		exit;
	}
	
}
